# coding: utf-8
import time
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice

device = MonkeyRunner.waitForConnection()

w = 720
h = 1280

print('go')

while True:
    # switch line
    device.touch(244, 96, MonkeyDevice.DOWN_AND_UP)
    time.sleep(3)

    # go line
    device.touch(566, 222, MonkeyDevice.DOWN_AND_UP)
    time.sleep(3)

    # auto kill
    device.touch(1222, 380, MonkeyDevice.DOWN_AND_UP)

    # att
    for i in range(1, 42):
        device.touch(1077, 620, MonkeyDevice.DOWN_AND_UP)
        time.sleep(2)

result = device.takeSnapshot()
result.writeToFile('/tmp/shot1.png', 'png')
